export const DYNAMIC_ROUTES = [
  // 首页
  {
    name: "home",
    path: "/home",
    meta: {
      title: "首页",
      permission: "home_manage_page"
    },
    component: () => import("@/pages/home/index")
  },

  // 账户设置
  {
    name: "account",
    path: "/account",
    component: () => import("@/pages/account/index"),
    children: [
      // 广告主账户管理
      {
        name: "account-advertiser-man",
        path: "advertiser-man",
        meta: {
          title: "广告主账户管理-账户",
          menu: "广告主账户管理",
          icon: "iconfont iconfont-14",
          aside: true,
          permission: "account_advertiser_page"
        },
        component: () => import("@/pages/account/advertiser-man")
      },
      // 广告主账户信息
      {
        name: "account-advertiser-basic",
        path: "advertiser-basic",
        component: () => import("@/pages/account/advertiser-basic")
      },
      // 广告主账户资质
      {
        name: "account-advertiser-aptitude",
        path: "advertiser-aptitude",
        component: () => import("@/pages/account/advertiser-aptitude")
      },
      // 其他账户管理
      {
        name: "account-admin-man",
        path: "admin-man",
        meta: {
          title: "其他账户管理-账户",
          menu: "其他账户管理",
          icon: "iconfont iconfont-14",
          aside: true,
          permission: "account_admin_page"
        },
        component: () => import("@/pages/account/admin-man")
      },
      // 其他账户信息
      {
        name: "account-admin-basic",
        path: "admin-basic",
        component: () => import("@/pages/account/admin-basic")
      },
      // 修改密码
      {
        name: "account-repassword",
        path: "repassword",
        component: () => import("@/pages/account/repassword"),
        meta: {
          permission: "account_advertiser_updatePwd"
        }
      }
    ]
  },

  // 推广
  {
    name: "generalize",
    path: "/generalize",
    component: () => import("@/pages/generalize/index"),
    children: [
      // 广告计划
      {
        name: "generalize-plan",
        path: "plan",
        meta: {
          title: "广告计划-推广",
          aside: true,
          custom: true,
          permission: "promote_page"
        },
        component: () => import("@/pages/generalize/plan")
      },
      // 广告单元
      {
        name: "generalize-cell",
        path: "cell",
        meta: {
          title: "广告单元-推广",
          aside: true,
          custom: true,
          permission: "promote_page"
        },
        component: () => import("@/pages/generalize/cell")
      },
      {
        name: "generalize-cell-detail",
        path: "cell-detail",
        meta: {
          title: "广告单元-推广",
          permission: "promote_page"
        },
        component: () => import("@/pages/generalize/cell-detail")
      },
      // 广告创意
      {
        name: "generalize-creative",
        path: "creative",
        meta: {
          title: "广告创意-推广",
          aside: true,
          custom: true,
          permission: "promote_page"
        },
        component: () => import("@/pages/generalize/creative")
      },
      {
        name: "generalize-creative-detail",
        path: "creative-detail",
        meta: {
          title: "广告创意-推广",
          permission: "promote_page"
        },
        component: () => import("@/pages/generalize/creative-detail")
      }
    ]
  },

  // 数据
  {
    name: "data",
    path: "/data",
    component: () => import("@/pages/data/index"),
    children: [
      // 广告主数据
      {
        name: "data-advertiser",
        path: "advertiser",
        meta: {
          title: "广告主数据-数据",
          menu: "广告主数据",
          icon: "iconfont iconfont-23",
          aside: true,
          custom: true,
          permission: "data_advertiser_page"
        },
        component: () => import("@/pages/data/advertiser")
      },
      // 总体数据
      {
        name: "data-total",
        path: "total",
        meta: {
          title: "总体数据-数据",
          menu: "总体数据",
          icon: "iconfont iconfont-37",
          aside: true,
          custom: true,
          permission: "data_user_page"
        },
        component: () => import("@/pages/data/total")
      },
      // 广告计划
      {
        name: "data-plan",
        path: "plan",
        meta: {
          title: "广告计划-数据",
          menu: "广告计划",
          icon: "iconfont iconfont-25",
          aside: true,
          custom: true,
          permission: "data_plan_page"
        },
        component: () => import("@/pages/data/plan")
      },
      // 广告单元
      {
        name: "data-cell",
        path: "cell",
        meta: {
          title: "广告单元-数据",
          menu: "广告单元",
          icon: "iconfont iconfont-26",
          aside: true,
          custom: true,
          permission: "data_unit_page"
        },
        component: () => import("@/pages/data/cell")
      },
      // 广告创意
      {
        name: "data-creative",
        path: "creative",
        meta: {
          title: "广告创意-数据",
          menu: "广告创意",
          icon: "iconfont iconfont-27",
          aside: true,
          custom: true,
          permission: "data_creative_page"
        },
        component: () => import("@/pages/data/creative")
      }
    ]
  },

  // 财务
  {
    name: "finance",
    path: "/finance",
    component: () => import("@/pages/finance/index"),
    children: [
      // 财务/财务管理
      {
        name: "finance-man",
        path: "man",
        meta: {
          title: "财务管理-财务",
          menu: "财务管理",
          icon: "iconfont iconfont-29",
          aside: true,
          permission: "financial_manage_page"
        },
        component: () => import("@/pages/finance/man")
      },

      // 财务/转账/账户转账管理
      {
        name: "finance-transfer-man",
        path: "transfer-man",
        meta: {
          title: "账户转账管理-财务",
          menu: "账户转账管理",
          icon: "iconfont iconfont-30",
          aside: true,
          permission: "financial_transfer_page"
        },
        component: () => import("@/pages/finance/transfer-man")
      },

      // 财务/转账/账户转账记录
      {
        name: "finance-transfer-detail",
        path: "transfer-detail",
        meta: {
          title: "账户转账记录-财务",
          menu: "账户转账记录",
          icon: "iconfont iconfont-31",
          aside: true,
          permission: "financial_transferDetail_page"
        },
        component: () => import("@/pages/finance/transfer-detail")
      },

      // 财务/adx消耗
      {
        name: "finance-adx-expend",
        path: "adx-expend",
        meta: {
          title: "ADX消耗管理-财务",
          menu: "ADX消耗管理",
          icon: "iconfont iconfont-33",
          aside: true,
          permission: "financial_adxConsum_page"
        },
        component: () => import("@/pages/finance/adx-expend")
      }
    ]
  },

  // 其他
  {
    name: "other",
    path: "/other",
    component: () => import("@/pages/other/index"),
    children: [
      // 直客审核
      {
        name: "other-account-audit",
        path: "account-audit",
        meta: {
          title: "直客待审核-其他",
          menu: "直客待审核",
          aside: true,
          permission: "other_aptitudeAudit_page"
        },
        component: () => import("@/pages/other/account-audit/unfinished")
      },
      {
        name: "other-account-audit-finished",
        path: "account-audit-finished",
        meta: {
          title: "直客已审核-其他",
          menu: "直客已审核",
          aside: true,
          permission: "other_aptitudeAudit_page"
        },
        component: () => import("@/pages/other/account-audit/finished")
      },
      {
        name: "other-account-audit-detail",
        path: "account-audit-detail",
        meta: {
          title: "直客审核详情-其他",
          permission: "other_aptitudeAudit_page"
        },
        component: () => import("@/pages/other/account-audit/detail")
      },
      // 物料审核
      {
        name: "other-creative-audit",
        path: "creative-audit",
        meta: {
          title: "物料待审核-其他",
          menu: "物料待审核",
          aside: true,
          permission: "other_creativeAudit_page"
        },
        component: () => import("@/pages/other/creative-audit/unfinished")
      },
      {
        name: "other-creative-audit-finished",
        path: "creative-audit-finished",
        meta: {
          title: "物料已审核-其他",
          menu: "物料已审核",
          aside: true,
          permission: "other_creativeAudit_page"
        },
        component: () => import("@/pages/other/creative-audit/finished")
      },
      {
        name: "other-creative-audit-detail",
        path: "creative-audit-detail",
        meta: {
          title: "物料审核详情-其他",
          permission: "other_creativeAudit_page"
        },
        component: () => import("@/pages/other/creative-audit/detail")
      },
      // 权限管理
      {
        name: "other-role",
        path: "role",
        meta: {
          title: "权限管理-其他",
          aside: true,
          permission: "other_permissionsManage_page"
        },
        component: () => import("@/pages/other/role/man")
      },
      {
        name: "other-role-detail",
        path: "role-detail",
        meta: {
          title: "角色管理-其他",
          permission: "other_permissionsManage_page"
        },
        component: () => import("@/pages/other/role/detail")
      },
      // 模板管理
      // {
      //   name: "other-template",
      //   path: "template",
      //   meta: {
      //     title: "模板管理-其他",
      //     aside: true,
      //     permission: "other_templateManage_page"
      //   },
      //   component: () => import("@/pages/other/template/man")
      // },
      // {
      //   name: "other-template-detail",
      //   path: "template-detail",
      //   meta: {
      //     title: "模板管理-其他",
      //     permission: "other_templateManage_page"
      //   },
      //   component: () => import("@/pages/other/template/detail")
      // }
    ]
  },
];

export const BASE_ROUTES = [
  // 登录
  {
    name: "login",
    path: "/login",
    meta: {
      title: "康远互动DSP平台"
    },
    alias: "/",
    component: () => import("@/pages/login")
  },
  // 进入账户
  {
    name: "jump",
    path: "/jump/:secret",
    meta: {
      title: "康远互动DSP平台"
    },
    component: () => import("@/pages/jump")
  },
  // 没有权限
  {
    name: "forbidden",
    path: "/forbidden",
    meta: {
      title: "康远互动DSP平台"
    },
    component: () => import("@/pages/forbidden")
  },
  // 404
  {
    name: "notFound",
    path: "*",
    meta: {
      title: "康远互动DSP平台"
    },
    component: () => import("@/pages/not-found")
  }
];